/*
 * Copyright (c) 18-3-19 下午1:10
 * Last modified time 18-3-19 下午1:10
 * Coded by Jhinwins(zouheng)
 * 人生入戏，全靠演技
 */
package com.jhinwins.equipmenteb.equipmentebserver.entity;

import com.jhinwins.equipmenteb.equipmentebserver.entity.common.GenerateId;

import javax.persistence.*;
import java.util.Map;

/**
 * 库存表，用来存储每种规格的商品的库存和价格
 */
@Table(name = "inventory")
@Entity
public class InventoryBean extends GenerateId {
    /**
     * 表示产品
     */
    @ManyToOne
    private ProductBean productBean;
    /**
     * 产品规格配置
     */
    @OneToMany(fetch = FetchType.EAGER)
    private Map<SpecificationBean, SpecValueBean> specCfg;
    /**
     * 该类商品价格
     */
    private Double price;
    /**
     * 库存数量
     */
    private Integer count;

    public InventoryBean() {
    }

    public InventoryBean(Long id) {
        super(id);
    }

    public ProductBean getProductBean() {
        return productBean;
    }

    public void setProductBean(ProductBean productBean) {
        this.productBean = productBean;
    }

    public Map<SpecificationBean, SpecValueBean> getSpecCfg() {
        return specCfg;
    }

    public void setSpecCfg(Map<SpecificationBean, SpecValueBean> specCfg) {
        this.specCfg = specCfg;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }
}